#include <catch2/catch.hpp>

#include "solution.hpp"

using namespace solution_080;

TEST_CASE("80. Remove Duplicates from Sorted Array II", "[080]") {

SECTION("example 1") {
    std::vector<int> nums{1,1,1,2,2,3};
    int len = Solution().removeDuplicates(nums);
    nums.resize(len);
    CHECK(len == 5);
    CHECK(nums == std::vector{1,1,2,2,3});
}

SECTION("example 2") {
    std::vector<int> nums{0,0,1,1,1,1,2,3,3};
    int len = Solution().removeDuplicates(nums);
    nums.resize(len);
    CHECK(len == 7);
    CHECK(nums == std::vector{0,0,1,1,2,3,3});
}

}
